package com.example.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.example.domain.ChargeType;

/**
 * @author 袁小弘
 * @describe 费用类型DAO层
 * @date 2020-02-18
 */
@Repository
public interface ChargeTypeDao extends JpaRepository<ChargeType, Integer> {

    @Transactional
    @Modifying
    Integer deleteByChargeTypeId(Integer chargeTypeId);

    List<ChargeType> findByChargeTypeId(Integer chargeTypeId);

    List<ChargeType> findByPid(Integer pid);

    @Transactional
    @Modifying
    Integer deleteByChargeTypeIdIn(List<Integer> listId);

    List<ChargeType> findByTypeNameLike(String string);

}
